<!--
 * @Author: sunli
 * @Date: 2024-02-20 09:47:59
 * @LastEditors: sunli
 * @LastEditTime: 2024-02-23 09:04:36
 * @FilePath: /debug/src/views/operation/project.vue
 * @Description: 
-->
<template>
	<div class="project">
    <div class="nav">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>应用管理</el-breadcrumb-item>
      </el-breadcrumb>
      <el-link type="primary" :underline="false" @click="router.push('/operation/project-add')">创建应用+</el-link>
    </div>
		<el-table :data="tableData" style="width: 100%">
      <el-table-column prop="name" label="应用名" />
      <el-table-column prop="language" label="语言" />
      <el-table-column prop="type" label="框架" />
      <el-table-column prop="KEY" label="KEY" />
      <el-table-column label="操作">
        <template #default="scope">
          <el-link type="primary" :underline="false" @click="router.push(`/operation/project-detail?KEY=${scope.row.KEY}`)">查看详情</el-link>
        </template>
      </el-table-column>
    </el-table>
	</div>
</template>
  
<script setup>
import { onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import httpReq from '@/request'

import useStore from '@/store/index'

const store = useStore()
const router = useRouter()
const userVO = store.userVO


const tableData = ref([])
onMounted(async() => {
  tableData.value = await httpReq.post('http://localhost:8092/project/list', {userName: userVO.userName})
})

const submit = () => {
}
</script>

<style lang="scss" scoped>
.project {
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 10px;
    border-bottom: 1px solid #dcdfe6;
  }
}
</style>
  